<%@tag pageEncoding="UTF-8"%>
<%@include file="screw.tag" %>
<%@ attribute name="code" type="java.lang.String" required="false" rtexprvalue="true"%>
<%@ attribute name="url" type="java.lang.String" required="false" rtexprvalue="true"%>

<%@attribute name="onclick" type="java.lang.String" required="false" rtexprvalue="true"%>

<c:if test="${disabled == 'true'}" >
	<c:set var="disabled" value="readonly='readonly'" />
</c:if>

<script type="text/javascript" src="${ctx }/base/js/dictionary/dictionary.js"></script>
<script type="text/javascript">
	
	$(function(){
		
		
		
		var is = "";
		var onclick = "";
		if ("${onclick}"!="") {
			onclick = "onclick=\"${onclick}\"";
		}
		
		var input = "<label><input id='${id }' "+onclick+" $check name='${name }' type='checkbox' value='$value' />$text</label>";
		
		
		
		if ("${code}"!= "") {
			var temp = "";
			var dic = dictionary.find("${code}");
			for (var i in dic) {
				
				var d = dic[i];
				if (d.code == "${value}") {
					temp = input.replace("$check", "checked='checked'");
				}else {
					temp = input.replace("$check", "");
				}
				is += temp.replace("$text",d.text).replace("$value",d.code);
			}
			
		}else if ("${url}"!= "") {
			
		}else {
			is += input.replace("$text","").replace("$value","${value}").replace("$check", "");
		}
		
		document.getElementById("checkBoxDiv").outerHTML = is;
	});
	
</script>

<!-- <input onclick=""/> -->
<div id="checkBoxDiv"></div>





